package com.tigercel.xiangchengyun.ui.activities

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import com.tigercel.xiangchengyun.R
import com.tigercel.xiangchengyun.adapter.MyCommentAdapter
import com.tigercel.xiangchengyun.entity.MyCommentEntity
import kotlinx.android.synthetic.main.activity_my_comment.*
import kotlinx.android.synthetic.main.include_titlebar.*

class MyCommentActivity : AppCompatActivity() {
    private lateinit var entities: MutableList<MyCommentEntity>
    private lateinit var adapter: MyCommentAdapter
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_my_comment)
        entities = ArrayList()
        titlebar_tv.text = "我的评论"
        titlebar_iv_left.visibility = View.VISIBLE
        titlebar_iv_left.setImageResource(R.drawable.btn_nav_back)
        titlebar_iv_left.setOnClickListener(View.OnClickListener { this.finish() })
        for (i in 0..6) {
            var entity = MyCommentEntity("", "测试用户", "钦州路", "12:36", "测试内容")
            entities.add(entity)
        }
        var layoutManager = LinearLayoutManager(this)
        adapter = MyCommentAdapter(R.layout.item_my_comment, entities)
        myCommentRecyclerView.layoutManager = layoutManager
        myCommentRecyclerView.adapter = adapter
    }
}
